package com.example.demo.server.impl;

import com.example.demo.mapper.GoodsMapper;
import com.example.demo.model.Goods;
import com.example.demo.server.GoodsServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServerImpl implements GoodsServer {
    @Autowired
    private GoodsMapper goodsMapper;
    @Override
    public void add(Goods goods) {
        goodsMapper.add(goods);
    }

    @Override
    public void delete(int number) {
        goodsMapper.delete(number);
    }

    @Override
    public void update(Goods goods,int targetnumber) {
        goodsMapper.update(goods,targetnumber);
    }

    @Override
    public List<Goods> list() {
        List<Goods> goods= (List<Goods>) goodsMapper.list();
        return  goods;
    }

    @Override
    public List<Goods> select(Integer number) {
        List<Goods> goods= goodsMapper.select(number);
        return goods;
    }
}
